<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>兴趣爱好</title>
    <script src="../js/ajax.js"></script>
    <script>

        function AddLike(){
            var likes = document.getElementsByTagName('input');
            var like="";
            for (var i = 0; i < likes.length; i++){
                if (likes[i].checked == true){
                    like += "like=" + likes[i].value + "&";
                }
            }

            get("../AddItemServlet?"+like,
                function (res){
                    alert(res.msg);
                });
        }
    </script>
</head>
<body>

<h1>兴趣爱好:</h1>
<input type="checkbox" value="听音乐">听音乐 <input type="checkbox" value="打篮球">打篮球
<input type="checkbox" value="踢足球">踢足球<br>
<a href="edu.html" onclick="AddLike();">下一页</a>
</body>
</html>